-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(esx_mechanicjob): rework and rewrite by Tizas #25
base: dev
Are you sure you want to change the base?
Conversation
client/main.lua
Outdated
cb(vehicle) | ||
end) | ||
|
||
Citizen.CreateThread(function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove Citizen. you can just trigger CreateThread no need for Citizen in front of it.
client/main.lua
Outdated
local playerPed = ESX.PlayerData.ped | ||
local playerCoords = GetEntityCoords(playerPed) | ||
local vehicle = ESX.Game.GetClosestVehicle(playerCoords) | ||
if vehicle == -1 then cb(false) end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not vehicle or vehicle == -1 then
return cb(false) -- return otherwise it will trigger cb(vehicle) as well
end
cb(vehicle)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Arctos2win ESX.Game.GetClosestVehicle
will either return -1 or an entity handle. No need to check for nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Arctos2win
ESX.Game.GetClosestVehicle
will either return -1 or an entity handle. No need to check for nil
didnt know the point was just the return before cb(false) otherwise cb(true) will also run even if there is no vehicle
client/modules/cloakroom.lua
Outdated
) | ||
end | ||
|
||
Citizen.CreateThread(function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Citizen. can be removed
client/modules/npcJob.lua
Outdated
end | ||
|
||
local function EndJob() | ||
if activeJob then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not activeJob then
return ESX.ShowNotification(TranslateCap('no_active_job'))
end
client/modules/npcJob.lua
Outdated
end | ||
|
||
local function MonitorRepair() | ||
Citizen.CreateThread(function() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove Citizen.
client/modules/npcJob.lua
Outdated
return EndJob() | ||
end | ||
print("Player Entered Zone") | ||
SpawnVehicle(job.vehicleCoords, job.carModel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spawn server side vehicle and add an extra step on server to check timing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brb, ill go bash my head into a wall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
textui still not handled correctly
is there anyway if i can edit this code ? and make a pr overit? |
@Capy1174 Once it is finished and merged, feel free to PR anything. |
No description provided.